// 删除数组左边的 index 个元素
export function shiftLeft<A>(array: Array<A>, index: number): void {
  const length = array.length;

  for (let i = index; i < length; ++i) {
    array[i - index] = array[i];
  }
  array.length = length - index;
}

const array = [0, 1, 2, 3, 4, 5, 6];
shiftLeft(array, 4);
console.log(array);
